#ifndef EDGE_H
#define EDGE_H
#include <QGraphicsItem>
#include"itemtype.h"
class ZigBeeNode;
/**
 * @brief The Edge class 两个节点之间的边缘线
 */
class Edge : public QGraphicsItem
{
public:
    Edge(ZigBeeNode *sourceNode, ZigBeeNode*destNode);

    ZigBeeNode *sourceNode() const;
    ZigBeeNode *destNode() const;

    void adjust();

    enum { Type = EdgeItemType };
    int type() const { return Type; }

protected:
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

private:
    ZigBeeNode *source, *dest;

    QPointF sourcePoint;
    QPointF destPoint;
    qreal arrowSize;
};
#endif // EDGE_H

